package reporting;
import java.util.*;
import util.*;
import static util.ConstantCollection.*;

@Deprecated
class ConsoleReport extends TemplateReport{
	private TestConfiguration tc = TestConfiguration.getInstance();
	
	public ConsoleReport(String name){
		super(name);
		String text;
		Util u = new Util();
		text = "Test title:\t" + tc.getEnv("_testtitle") + "\n";
		text = text + "Test name:\t" + tc.getEnv("_testname") + "\n";
		text = text + "Time zone:\t" + u.getTimeZone() + "\n";
		text = text + "Text log started:\t" + u.getTimeNow() + ".\n";
		System.out.print(text);
		String headerLog = "-------------------------------------------------------------------------------------\n " +
			"ID\tTYPE\tSTATUS\tHEADER\tDESCRIPTION\tERRID\n"; 
		System.out.print(headerLog);
	}
		    
	public void report(Message objMsg){
		String txt;
		if(objMsg.getId() == null){
			
			txt = "-------------------------------------------------------------------------------------\n ";
		}else{
			txt = objMsg.getId();
		}
		txt = txt + "\t" + objMsg.getMessageType() + "\t" + getStatusName(objMsg.getStatus())
			+ "\t" + objMsg.getHeader() + "\t" + objMsg.getDescription();
		if(objMsg.getErrorId() == null){
			txt = txt + "\n" + "-------------------------------------------------------------------------------------\n";
		}else{
			txt = txt + "\t" + objMsg.getErrorId() + "\n";
		}
		System.out.print(txt);
	}
}



